import logging



import config


class OpenAccountApi(object):
    """
    =
    """

    def __init__(self, session):
        self.session1 = session

    # 实名认证接口
    def realname(self, body):
        """

        :param body: 实名认证body

        :return: 返回响应结果
        """

        re = self.session1.post(url=config.BASE_HOST + '/member/realname/approverealname', data=body, files={"x": "y"})
        logging.info("实名认证接口返回的响应体数据：{}".format(re.json()))
        print("开户接口返回的响应体数据：{}".format(re.json()))
        return re

    # 开户接口
    def open_account(self):
        """

        :return: 返回开户响应体数据
        """
        re = self.session1.post(url=config.BASE_HOST + '/trust/trust/register')
        logging.info("开户接口返回的响应体数据：{}".format(re.json()))
        print("开户接口返回的响应体数据：{}".format(re.json()))
        return re

    # 第三方开户接口
    def third_open_account(self, url, form_dict):
        re = self.session1.post(url=url, data=form_dict)
        logging.info("第三方开户接口返回的响应体数据：{}".format(re.text))

        return re




